﻿using System;


    class Program
    {
        static void Gen_randomarray(int[] array, int len)
        {
            int min = 0, max = 99;
            Console.WriteLine("generating an random array:");
            Random rand = new Random();
            for (int i = 0; i < len ; i++)
            {
                array[i] = rand.Next(min, max + 1);
                Console.Write(array[i]+" ");
            }
            Console.WriteLine();
        }
        static void Main(string[] args)
        {
            int length = 10;
            int []array = new int[length];
            Gen_randomarray(array, array.Length);
            int max = array[0];
            int min = array[0];
            int sum = 0;

            for (int i = 0; i < array.Length; i++)
            {
                if (array[i] > max)
                {
                    max = array[i];
                }

                if (array[i] < min)
                {
                    min = array[i];
                }

                sum += array[i];
            }

            double average = (double)sum / array.Length;

            Console.WriteLine($"max：{max}");
            Console.WriteLine($"min：{min}");
            Console.WriteLine($"average：{average:F2}");
            Console.WriteLine($"sum：{sum}");
        }
    }